import random


class Solution:
    def rand7(self):
        return random.randint(0, 7)

    def rand10(self):
        a = self.rand7()
        b = self.rand7()
        while(a == 7):
            a = self.rand7()
        while(b > 5):
            b = self.rand7()
        return (a & 1)*5+b


if __name__ == "__main__":
    print(Solution().rand10())
    print(Solution().rand10())
    print(Solution().rand10())
